home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 21 / PC Format CD-ROM Collection 21 (1995-12)(Future Publishing)(GB)[issue 51].iso / resource / rays.poc < prev    next >
Text File  |  1990-08-02  |  416b  |  34 lines

  1. // rays - wait for pen click then draw lines connecting the initial point to 
  2. // point where pen is down.
  3.  
  4. do_rays(int xc,int yc)
  5. {;
  6. int x,y;
  7. int l,r,k;
  8. for (;;)
  9.     {
  10.     if (!RubLine(xc,yc,&x,&y))
  11.         break;
  12.     do
  13.         {
  14.         Line(xc,yc,x,y);
  15.         PollInput(&x,&y,&l,&r,&k);
  16.         }
  17.     while (l);
  18.     }
  19. }
  20.  
  21. main()
  22. {
  23. int x,y,l,r,k;
  24.  
  25. for (;;)
  26. {
  27. WaitClick(&x,&y,&l,&r,&k);
  28. if (!l)
  29.     break;
  30. else
  31.     do_rays(x,y);
  32. }
  33. }
  34.